<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml" >
<head th:replace="admin/_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>标签管理</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
    <link rel="stylesheet" href="../../static/css/me.css">
</head>
<style>
    body {
        background: #fafafa;
        background-attachment: fixed !important;
        background-size: cover !important;
    }
</style>
<body>
<!--导航-->
<nav th:replace="admin/_fragments :: menu(3)" class="ui top fixed menu">
    <!--流动导航组件-->
    <div class="m-container">
        <div class="ui secondary stackable menu">
            <div class="item">
                <h2 class="ui header">Ended</h2>
            </div>&nbsp;

            <div class="ui dropdown item m-item m-mobile-hide" th:classappend="${n==1} ? 'active'">
                <div class="text">
                    <i class="anchor icon"></i>博客管理
                </div>
                <div class="menu">
                    <a href="#" th:href="@{/admin/blogs}" class="item">博客列表</a>
                    <a href="#" th:href="@{/admin/blogs/input}" class="item">博客发布</a>
                </div>
            </div>
            <div class="ui dropdown item m-item m-mobile-hide" th:classappend="${n==2} ? 'active'">
                <div class="text">
                    <i class="idea icon"></i>分类管理
                </div>
                <div class="menu">
                    <a href="#" th:href="@{/admin/types}" class="item">分类列表</a>
                    <a href="#" th:href="@{/admin/types/input}" class="item">新增分类</a>
                </div>
            </div>
            <div class="ui dropdown item m-item m-mobile-hide" th:classappend="${n==3} ? 'active'">
                <div class="text">
                    <i class="idea icon"></i>标签管理
                </div>
                <div class="menu">
                    <a href="#" th:href="@{/admin/types}" class="item">标签列表</a>
                    <a href="#" th:href="@{/admin/types/input}" class="item">新增标签</a>
                </div>
            </div>
            <a href="#" th:href="@{/admin/message}" class="m-item item m-mobile-hide" th:classappend="${n==4} ? 'active'">
                <i class="comment alternate icon"></i>留言管理</a>
            <a href="#" th:href="@{/admin/about}" class="m-item item m-mobile-hide" th:classappend="${n==5} ? 'active'">
                <i class="info icon"></i>博主信息</a>
            <div class="m-item item m-mobile-hide">
                <a class="ui basic vertical animated circular button" href="#" target="_blank" th:href="@{/admin/logout}"
                   tabindex="0">
                    <div class="hidden content">注销</div>
                    <div class="visible content">
                        <i class="cloud icon"></i>
                    </div>
                </a>
            </div>
        </div>
    </div>
    <a href="#" class="ui menu toggle basic icon button m-top-right m-mobile-show m-bg">
        <i class="sidebar icon"></i>
    </a>
</nav>

<!--中间内容-->
<div class="m-padded-tb-max m-container-small">
    <div class="ui container">
        <div class="ui success message" th:unless="${#strings.isEmpty(message)}">
            <i class="close icon"></i>
            <div class="header">提示: </div>
            <p th:text="${message}">恭喜你，操作成功！</p>
        </div>
        <!--表内容-->
        <table class="ui celled table">
            <!--表头-->
            <thead>
                <tr class="center aligned">
                    <th></th>
                    <th>分类名称</th>
                    <th>操作</th>
                </tr>
            </thead>
            <!--中间内容-->
            <tbody>
                <tr class="center aligned" th:each="tags,iterStat : ${page.content}">
                    <td th:text="${iterStat.count}">1</td>
                    <td th:text="${tags.name}">旅行日记(一)</td>
                    <td>
                        <a href="#" th:href="@{/admin/tags/{id}/input(id=${tags.id})}" class="ui mini teal basic button">编辑</a>
                        <a href="#" th:href="@{/admin/tags/{id}/delete(id=${tags.id})}" class="ui mini orange basic button">删除</a>
                    </td>

                </tr>

            </tbody>
            <!--footer分页-->
            <tfoot>
                <tr>
                    <th colspan="6">
                        <div class="ui middle aligned three column grid">
                            <div class="center aligned column">
                                <a href="#" th:href="@{/admin/tags/input}" class="ui mini secondary basic button"><i class="plus icon"></i>新  增</a>
                            </div>
                            <div class="center aligned column"  th:if="${page.totalPages}>1">
                                <a href="#" th:href="@{/admin/tags(page=${page.number}-1)}"
                                   class="ui mini teal basic button" th:unless="${page.first}">上一页</a>
                            </div>
                            <div class="center aligned column"  th:if="${page.totalPages}>1">
                                <a href="#" th:href="@{/admin/tags(page=${page.number}+1)}"
                                   class="ui mini teal basic button" th:unless="${page.last}">下一页</a>
                            </div>
                        </div>
                    </th>
                </tr>
            </tfoot>
        </table>
    </div>
</div>

<!--底部footer-->
<footer th:replace="admin/_fragments :: footer" class="ui m-bg segment m-padded-tb-huge">
    <div class="ui center aligned container">
        <div class="ui divided stackable grid"> <!--布局会分成16份-->
            <div class="four wide column">
                <img src="../../static/images/plug/WeChat.PNG" alt="WeChatQR Code" class="ui centered rounded image"
                     style="width: 110px">
            </div>
            <div class="four wide column">
                <h4 class="ui header m-opacity-small">博客简介</h4>
                <p class="m-text-thin m-text-spaced m-opacity-small">
                    创建此博客是为了提供一个平台来供自己分享生活、自己的所见所闻所感、以及分享学习心得和资源......
                </p>
            </div>
            <div class="four wide column">
                <h4 class="ui header m-opacity-small">联系我</h4>
                <div class="ui link list ">
                    <a href="#" class="item">QQ：3320014521</a>
                    <a href="#" class="item">e-mail：woshihauhuaa@outlook.com</a>
                </div>
            </div>
            <div class="four wide column">
                <div class="three wide column">
                    <br>
                    <br>
                    <p class="m-text-thin m-text-spaced">
                        愿你编码半生，归来仍是少年......
                    </p>
                </div>
            </div>
        </div>
        <div class="ui inverted section divider"></div>
        <p class="m-text-thin m-opacity-mini">Copyright © 2020-2021 YanYunHua Designed by YanYunHua</p>
    </div>
</footer>


<!--/*/<th:block th:replace="admin/_fragments :: script">/*/-->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
<!--/*/</th:block>/*/-->

<!--导航的手机端按钮的响应页面-->
<script>
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide')
    })
    ;
    $('.ui.dropdown').dropdown({
        on : 'hover'
    });
    //消息提示关闭初始化
    $('.message .close')
        .on('click',function () {
            $(this).closest('.message')
                .transition('fade');
    })
</script>

</body>
</html>